<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
// 网站地址
String netPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();

response.setHeader("Pragma","No-cache");  
response.setHeader("Cache-Control","no-cache");  
response.setDateHeader("Expires",0);
%>
<style type="text/css">
	.cutTitle{
		width: 250px;
		display:block;
		overflow:hidden;
		white-space:nowrap;
		text-overflow:ellipsis;
		text-overflow: ellipsis;/* IE/Safari */
		-ms-text-overflow: ellipsis;
		-o-text-overflow: ellipsis;/* Opera */
		-moz-binding: url("ellipsis.xml#ellipsis");/*FireFox*/ 
	}

</style>
<div>
<input type="hidden" name="pageSum" value="${pageSum}" id="pageSum"/>
<table width="100%" border="0" height="100%" cellpadding="0" cellspacing="0" class="yhgltable_1">
   <thead>
     <tr>
       <th width="10%">文章ID</th>
       <th width="24%">标题</th>
       <th width="10%">所属栏目</th>
       <th width="10%">来源</th>
      <!-- <th width="10%">作者</th> -->
	   <th width="10%">置顶</th>
       <th width="8%">缩略图</th>
       <c:if test="${red!=1}">
	       <th width="5%">推荐</th>
	   </c:if>
		   <th width="15%">发布时间</th>
	   <c:if test="${red!=1}">
	   <th width="110px">修改</th>
	   </c:if>
     </tr>
   </thead>
   <c:forEach items="${lstNewsTitle.data}" var="newsInfo" varStatus="stats">
        <c:if test="${stats.index%2==0}">
		  <tr>
	    </c:if>
		<c:if test="${stats.index%2==1}">
				<tr class="gray">
		</c:if>
           <td ><p>
               &nbsp;&nbsp;<input type="checkbox" name="group_box" value="${newsInfo.id}">
               ${newsInfo.id}</p></td>
           <td><a href="<%=netPath%>/article/${newsInfo.id}.html" target="_blank" class="cutTitle">${newsInfo.title}</a></td>
           <!-- cname -->
           <td ><a href="<%=netPath%>/channel/${newsInfo.cid}.html" target="_blank">${newsInfo.cname}</a></td>
           <td>${newsInfo.copyfrom}</td>
          <%--  <td >${newsInfo.author}</td> --%>
           <%-- <td width="12%">${newsInfo.iftop}</td> --%>
	           <td>
	           	<img alt="置顶升级" src="<%=basePath%>images/arrow_up.png" class="ifTop" style="width:20px;" title="置顶升级" onclick="makeTop(${newsInfo.id})"/>
	     		<img alt="置顶降级" src="<%=basePath%>images/arrow_down.png" class="ifTop" title="置顶降级" style="width:20px;" onclick="makeLower(${newsInfo.id})"/>
	       		<input type="text" id="iftop_${newsInfo.id}" value="${newsInfo.iftop}" readonly="readonly" style="position: relative;top: -5px;width:10px;"/>
	           </td>
          
           <td>
           		<c:choose>
           			<c:when test="${newsInfo.ispic==1}">
           				是
           			</c:when>
           			<c:otherwise>
           				否
           			</c:otherwise>
           		</c:choose>
         </td>
          <c:if test="${red!=1}">
	          <td>
		          <c:choose>
		          	<c:when test="${newsInfo.ifelite==1}">
		          		<img alt="取消推荐" src="<%=basePath%>images/commends1.png" id="recommendImg_${newsInfo.id}" style="width:20px;cursor: pointer" title="取消推荐" onclick="changeRecommendStat(${newsInfo.id})"/>
		          	</c:when>
		          	<c:otherwise>
		          		<img alt="推荐" src="<%=basePath%>images/commends0.png" id="recommendImg_${newsInfo.id}" style="width:20px;cursor: pointer" title="推荐" onclick="changeRecommendStat(${newsInfo.id})"/>
		          	</c:otherwise>
		          </c:choose>
		          <input type="hidden" id="recommendItem_${newsInfo.id}" value="${newsInfo.ifelite}"  style="width:10px;"/>
	         </td>
         </c:if>
           <td ><fmt:formatDate value="${newsInfo.posttime}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>
         <c:if test="${red!=1}">
           <td ><div class="btn1" style="float:right;width:110px;"><a href="javascript:void(0)" onclick="toUpdate(${newsInfo.id})" style="float: right;"><img src="<%=basePath%>images/xg.gif" />修改</a></div></td>
       	 </c:if>
        </tr>
   </c:forEach>  
</table>
</div>
<style>
	.ifTop {
		cursor:pointer;
	}
</style>